//
//  CLTableViewCell.m
//  CLPlayerDemo
//
//  Created by JmoVxia on 2017/8/4.
//  Copyright © 2017年 JmoVxia. All rights reserved.
//

#import "CLTableViewCell.h"
#import "UIView+CLSetRect.h"
#import <SDWebImage/SDWebImage.h>
#import "HWCommentspingluView.h"

#import "HWerweiMaFenXiangView.h"


#define CellHeight   300
#define ImageViewHeight 300

@interface CLTableViewCell ()

/**button*/
@property (nonatomic,strong) UIButton *button;
/**picture*/
@property (nonatomic,strong) UIImageView *pictureView;


//@property(strong,nonatomic) UIView *cardView;



@end

@implementation CLTableViewCell
#pragma mark - 懒加载
/**button*/
- (UIButton *) button{
    if (_button == nil){
        _button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 60)];
        //   [_button setBackgroundImage:[self getPictureWithName:@"CLPlayBtn"] forState:UIControlStateNormal];
        
        [_button setBackgroundImage:[UIImage imageNamed:@"btn_video"] forState:UIControlStateNormal];
        
        // _button.backgroundColor = [UIColor redColor];
        [_button addTarget:self action:@selector(playAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _button;
}
/**pictureView*/
- (UIImageView *) pictureView{
    
    if (_pictureView == nil){
        _pictureView = [[UIImageView alloc] initWithFrame:CGRectMake(0, - (ImageViewHeight - CellHeight) * 0.5, CLscreenWidth, ImageViewHeight)];    }
    return _pictureView;
}


//卡片




#pragma mark - 入口
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        [self initUI];
    }
    return self;
}
- (void)initUI{
    //剪裁看不到的
    self.clipsToBounds       = YES;
    self.selectionStyle      = UITableViewCellSelectionStyleNone;
    [self.contentView addSubview:self.pictureView];
    [self.contentView addSubview:self.button];
    [self.button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.pictureView);
    }];
    [self.pictureView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.contentView);
        make.width.mas_equalTo(CLscreenWidth);
        make.height.mas_equalTo(ImageViewHeight);
    }];
    
    [self tianjizhangtiAnniu];
    [self addjianqitaView];
    
}

// 添加暂停按钮
- (void)tianjizhangtiAnniu {
    
    //  suspendedBut
    
    self.suspendedBut  = [UIButton buttonWithType:UIButtonTypeCustom];
    self.suspendedBut.frame = CGRectMake(0,(CLscreenHeight- ImageViewHeight)/2, (CLscreenWidth/2)-30, ImageViewHeight);
    
    self.suspendedBut.backgroundColor = [UIColor clearColor];
    //      self.suspendedBut.layer.cornerRadius = 6;
    //      self.suspendedBut.layer.masksToBounds = YES;
    //   self.suspendedBut.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.suspendedBut];
    //    [self.suspendedBut mas_makeConstraints:^(MASConstraintMaker *make) {
    //        make.center.mas_equalTo(self.contentView);
    //    }];
    
    
    
}



// 卡片UIview
- (void)addjianqitaView {
    
    
    
    self.cardView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, CLscreenWidth, 80)];
    self.cardView.backgroundColor = [UIColor  redColor];
    self.cardView.layer.cornerRadius = 10;
    self.cardView.layer.masksToBounds = YES;
    self.cardView.backgroundColor = RGB(66, 66, 66);
    [self.contentView addSubview:self.cardView];
    self.cardView.userInteractionEnabled = YES;
    self.cardView.frame = CGRectMake(12, CLscreenHeight - TabBarHeight -80-10 - StatusBarHeight - 50, CLscreenWidth-24, 80);
    
    UITapGestureRecognizer *kaipaitapshijian = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(kaipian)];
    
    [self.cardView addGestureRecognizer:kaipaitapshijian];
    
    [self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-10);
        make.left.mas_equalTo(12);
        make.right.mas_equalTo(-12);
        make.height.mas_equalTo(80);
        
    }];
    
    [self diyigekaipianView];
    
    
    
    
    //  self.rightView = [UIView alloc]initWithFrame:CGRectMake(<#CGFloat x#>, <#CGFloat y#>, 80, 100)
    
    self.rightView = [[UIView alloc]initWithFrame:CGRectMake(kScreenW-80, (kScreenH-(40+(26+20+20)*3))/2-CF_StatusBarHeight, 80+2, 40+(26+20+20)*3)];
    self.rightView.backgroundColor = [UIColor clearColor];
    // self.rightView.backgroundColor = [UIColor redColor];
    self.rightView.userInteractionEnabled = YES;
    [self.contentView addSubview:self.rightView];
    
    
    
    
    
    UITapGestureRecognizer *rightViewkaipaitapshijian = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(kaipian)];
    
    [self.rightView addGestureRecognizer:rightViewkaipaitapshijian];
    
    
    
    
    [self diergeView];
    
    
    
}

// 第一个卡片UIview
- (void)diyigekaipianView {
    
    
    self.icoiamgeView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 14, 52, 52)];
    self.icoiamgeView.backgroundColor = [UIColor yellowColor];
    self.icoiamgeView.layer.cornerRadius = 10;
    self.icoiamgeView.layer.masksToBounds = YES;
    [self.cardView addSubview:self.icoiamgeView];
    
    
    
    
    
    
    
    UILabel *netLabel = [[UILabel alloc]initWithFrame:CGRectMake( self.icoiamgeView.right+10, 11, kScreenW-100, 22)];
    netLabel.textColor  = [UIColor whiteColor];
    netLabel.text = @"游戏名称";
    netLabel.font = [UIFont systemFontOfSize:16];
    self.mingchengLabel = netLabel;
    [self.cardView addSubview:netLabel];
    
    
    
    
    self.starsBut = [UIButton  createNormalButtonWithFrame:CGRectMake(self.icoiamgeView.right+10, self.mingchengLabel.bottom+1, 15+8+3, 14) Image:@"stars_ico" Title:@"8.0" font:10 imageSize:CGSizeMake(8, 8)];
    [self.starsBut layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleLeft imageTitleSpace:3];
    [self.cardView addSubview: self.starsBut];
    
    //   [HWjianzhiduiObject keylocalization:@"详情"];
    
    self.downloadBut  = [UIButton setButtonWithFrame:CGRectMake(kScreenW-58-10-30, (80-24)/2, 58, 24) Title: [HWjianzhiduiObject keylocalization:@"详情"] Image:nil Font:15 Color:RGB(255, 255, 255) Target:self Selector:@selector(downloadButtap)];
    self.downloadBut.backgroundColor = [UIColor  bm_colorGradientChangeWithSizeView: self.downloadBut];
    self.downloadBut.layer.cornerRadius = 6;
    self.downloadBut.layer.masksToBounds = YES;
    [self.cardView addSubview:self.downloadBut];
    
    
    for (int i = 0; i < 3; i++) {
        
        
        UILabel *textlabel = [[UILabel alloc]initWithFrame:CGRectMake(self.icoiamgeView.right+10+i*50+i*5, self.starsBut.bottom+5, 50, 14)];
        textlabel.text = @"礼包";
        textlabel.textAlignment =  NSTextAlignmentCenter;
        textlabel.textColor = [UIColor whiteColor];
        textlabel.font = [UIFont systemFontOfSize:10];
        textlabel.tag = i+100;
        textlabel.backgroundColor = [UIColor redColor];
        textlabel.layer.cornerRadius = 2;
        textlabel.layer.masksToBounds = YES;
        [self.cardView addSubview:textlabel];
        textlabel.hidden = YES;
        
    }
    
    
    
    
    
    
    
    
}

// 第二个Uiview
- (void)diergeView {
    
    
    //      HWerweiMaFenXiangView  *fenxiang = [[HWerweiMaFenXiangView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
    //         fenxiang.urlStr = self.topModel.ios;
    //         [kKeyWindow addSubview:fenxiang];
    //
    
    
    
    self.touxiangimageView   = [[UIImageView alloc] initWithFrame:CGRectMake(19, 0, 42, 42)];
    self.touxiangimageView.backgroundColor = [UIColor yellowColor];
    self.touxiangimageView.layer.cornerRadius = 10;
    self.touxiangimageView.layer.masksToBounds = YES;
    self.touxiangimageView.userInteractionEnabled = YES;
    [self.rightView addSubview:self.touxiangimageView];
    
    
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(touxiangimageViewTap)];
    [self.touxiangimageView  addGestureRecognizer:tap1];
    
    
    
    
    
    
    self.jiaGuanImageView = [[UIImageView alloc]initWithFrame:CGRectMake((80-14)/2, 35, 14, 14)];
    self.jiaGuanImageView.image = [UIImage imageNamed:@"addAttention"];
    //  self.jiaGuanImageView.backgroundColor = [UIColor redColor];
    [self.rightView addSubview:self.jiaGuanImageView];
    
    
    
    
    self.dianzanButon = [UIButton  createNormalButtonWithFrame:CGRectMake(0, 42+(26+20+20)*0+20, 80, 26+20) Image:@"giveALike" Title:@"100" font:10 imageSize:CGSizeMake(26, 26)];
    [self.dianzanButon layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:3];
    [self.dianzanButon addTarget:self action:@selector(giveALikeTap) forControlEvents:UIControlEventTouchUpInside];
    [self.rightView addSubview: self.dianzanButon];
    
    
    
    
    self.pinglunButon = [UIButton  createNormalButtonWithFrame:CGRectMake(0, 42+(26+20+20)*1+20, 80, 26+20) Image:@"pinglun_ico" Title:@"100" font:10 imageSize:CGSizeMake(26, 26)];
    [self.pinglunButon layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:3];
    [self.pinglunButon addTarget:self action:@selector(pinglunButonTap) forControlEvents:UIControlEventTouchUpInside];
    [self.rightView addSubview: self.pinglunButon];
    
    
    
    self.fenxiangButon = [UIButton  createNormalButtonWithFrame:CGRectMake(0, 42+(26+20+20)*2+20, 80, 26+20) Image:@"fenxiang_ico" Title:@"100" font:10 imageSize:CGSizeMake(26, 26)];
    [self.fenxiangButon layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:3];
    [self.fenxiangButon addTarget:self action:@selector(fenxiangButonTap) forControlEvents:UIControlEventTouchUpInside];
    
    
    
    
    [self.rightView addSubview: self.fenxiangButon];
    
    
    
    
    
    
}




- (void)downloadButtap {
    
    
    
    NSLog(@"xiazaid");
    
    
    
    HWGameDetailController *game = [[HWGameDetailController alloc]init];
    game.gameId = self.model.gid;
    [[[HWViewUtils  getCurrentVC] navigationController]  pushViewController:game animated:YES];
    
    
    
    
    
    
    
}




-(void)setModel:(CLModel *)model{
    _model = model;
    __block UIImage *placeholderImage = [UIImage imageNamed:@"placeholder"];
    __weak __typeof(self) weakSelf = self;
    [[SDImageCache sharedImageCache] diskImageExistsWithKey:_model.image completion:^(BOOL isInCache) {
        __typeof(&*weakSelf) strongSelf = weakSelf;
        if (isInCache) {
            //本地存在图片,替换占位图片
            placeholderImage = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:model.image];
        }
        [strongSelf.pictureView sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:placeholderImage];
    }];
    
    
    self.mingchengLabel.text = model.name;
    [self.icoiamgeView sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:nil];
    
    [self.starsBut setTitle:model.point forState:UIControlStateNormal];
    
    
    
    
    
    
    NSArray *arr =    model.biaoqian;
    
    
    for (int i = 0; i < arr.count; i++) {
        UILabel *label = [self.cardView   viewWithTag:100+i];
        label.hidden = NO;
        label.text = arr[i];
        
        if (i == 0 ) {
            label.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(label.frame.size.width, label.frame.size.height) direction:IHGradientChangeDirectionLevel startColor:RGB(255, 188, 114) endColor:RGB(255, 43, 69)];
            label.textColor = RGB(255, 255, 255);
            
        } else if (i == 1) {
            
            label.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(label.frame.size.width, label.frame.size.height) direction:IHGradientChangeDirectionLevel startColor:RGB(255, 242, 217) endColor:RGB(227, 200, 148)];
            label.textColor = RGB(61, 61, 72);
            
        } else {
            
            
            label.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(label.frame.size.width, label.frame.size.height) direction:IHGradientChangeDirectionLevel startColor:RGB(124, 174, 255) endColor:RGB(34, 94, 255)];
            
            label.textColor = RGB(255, 255, 255);
        }
        
        
    }
    
    
    
    [self.dianzanButon  setTitle:model.zan forState:UIControlStateNormal];
    [self.dianzanButon layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:3];
    
    [self.pinglunButon  setTitle:model.discuss forState:UIControlStateNormal];
    [self.pinglunButon layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:3];
    [self.fenxiangButon  setTitle:model.share forState:UIControlStateNormal];
    [self.fenxiangButon layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:3];
    
    
    [self.touxiangimageView sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:nil];
    
    
    //  NSString *is_zan  = self.model.is_zan
    if ([self.model.is_zan  isEqualToString:@"0"]) {
        
        [self.dianzanButon setImage:[UIImage imageNamed:@"giveALike"] forState:UIControlStateNormal];
        
    } else {
        
        //   [self.dianzanButon setImage:[UIImage imageNamed:@"giveALike"] forState:UIControlStateNormal];
        
        [self.dianzanButon setImage:[UIImage imageNamed:@"dianzangaoliang"] forState:UIControlStateNormal];
        
        
    }
    
    
    if ([self.model.is_guanzhu isEqualToString:@"0"]) {
        
        self.jiaGuanImageView.hidden  =NO;
        
        
    } else {
        
        self.jiaGuanImageView.hidden  = YES;
        
    }
    
    
    
    
}











- (void)playAction:(UIButton *)button{
    if (_delegate && [_delegate respondsToSelector:@selector(cl_tableViewCellPlayVideoWithCell:)]){
        [_delegate cl_tableViewCellPlayVideoWithCell:self];
    }
}
- (UIImage *)getPictureWithName:(NSString *)name{
    NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"CLPlayer" ofType:@"bundle"]];
    NSString *path   = [bundle pathForResource:name ofType:@"png"];
    return [UIImage imageWithContentsOfFile:path];
}
- (CGFloat)cellOffset{
    /*
     - (CGRect)convertRect:(CGRect)rect toView:(nullable UIView *)view;
     将rect由rect所在视图转换到目标视图view中，返回在目标视图view中的rect
     这里用来获取self在window上的位置
     */
    CGRect toWindow      = [self convertRect:self.bounds toView:self.window];
    //获取父视图的中心
    CGPoint windowCenter = self.superview.center;
    //cell在y轴上的位移
    CGFloat cellOffsetY  = CGRectGetMidY(toWindow) - windowCenter.y;
    //位移比例
    CGFloat offsetDig    = 2 * cellOffsetY / self.superview.frame.size.height ;
    //要补偿的位移,self.superview.frame.origin.y是tableView的Y值，这里加上是为了让图片从最上面开始显示
    CGFloat offset       = - offsetDig * (ImageViewHeight - CellHeight) / 2;
    
    // CGFloat offset       = - offsetDig * (ImageViewHeight - CLscreenHeight) / 2;
    //让pictureViewY轴方向位移offset
    CGAffineTransform transY = CGAffineTransformMakeTranslation(0,offset);
    
    
    _pictureView.transform   = transY;
    return offset;
}
-(void)layoutSubviews{
    
    
    
    [super layoutSubviews];
    
    
    
    //    _button.CLcenterX     = self.CLwidth/2.0;
    //    _button.CLcenterY     = self.CLheight/2.0;
    //    _pictureView.CLwidth  = self.CLwidth;
    
    //     _pictureView.frame = CGRectMake(0,(CLscreenHeight- ImageViewHeight-TabBarHeight)/2,CLscreenWidth, ImageViewHeight);
    self.suspendedBut.frame = CGRectMake(0,(CLscreenHeight- ImageViewHeight)/2, (CLscreenWidth/2)-30, ImageViewHeight);
    
    
}









//点赞
- (void)giveALikeTap {
    
    [self.delegate  kaipianViewcl_tableViewCellPlayVideoWithCell:self];
    
    NSString *uid = [HWLocallyStoredData getLoginUserID];
    NSString *tString = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    //  NSString *gidStr = [NSString stringWithFormat:@"%@",self.gameId];
    NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uid,tString,@"fsd213ewdsadqwe2121213edsad"];
    NSString *signMD5 = [WMUtil md5HexDigest:signStr];
    
    NSString *type = @"0";
    
    NSDictionary *parametes = @{
        
        @"uid":uid,
        @"t":tString,
        @"sign":signMD5,
        @"id":self.model.id,
        @"ct":@"app",
        @"ac":@"video_zan",
        @"ios" : @"1",
        @"member_id":[HWLocallyStoredData getCode],
        
        
        
    };
    
    
    
    
    [HWWebUtils do3GetWithParameters:parametes progress:nil success:^(id response) {
        
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        
        if ([codeStr intValue] == 1) {
            // [MBProgressHUD showMessage:@"收藏成功" toView:self.view];
            
            
            //    self.model.zan
            
            
            NSString *str = [NSString stringWithFormat:@"%@",response[@"message"]];
            
            if ([str isEqualToString:@"取消成功"]) {
                if ([self.model.zan containsString:@"w"]) {
                    
                } else {
                    NSInteger zan = [self.model.zan intValue] - 1;
                    NSString *zanStr = [NSString stringWithFormat:@"%ld",zan];
                    self.model.zan = zanStr;
                    [self.dianzanButon setTitle:zanStr forState:UIControlStateNormal];
                }
                
                
                [self.dianzanButon layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:3];
                [self.dianzanButon setImage:[UIImage imageNamed:@"giveALike"] forState:UIControlStateNormal];
                self.model.is_zan = @"0";
                
                
            } else {
                
                if ([self.model.zan containsString:@"w"]) {
                    
                } else {
                    NSInteger zan = [self.model.zan intValue] + 1;
                    NSString *zanStr = [NSString stringWithFormat:@"%ld",zan];
                    
                    self.model.zan = zanStr;
                    [self.dianzanButon setTitle:zanStr forState:UIControlStateNormal];
                }

                
                [self.dianzanButon layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:3];
                
                [self.dianzanButon setImage:[UIImage imageNamed:@"dianzangaoliang"] forState:UIControlStateNormal];
                
                
                self.model.is_zan = @"1";
                
                
                
                
            }
            
            
            //                  NSInteger zan = [self.model.zan intValue] + 1;
            //                  NSString *zanStr = [NSString stringWithFormat:@"%ld",zan];
            //                  [self.dianzanButon setTitle:zanStr forState:UIControlStateNormal];
            //
            //
            
            
            
            
        } else {
            
            
            // [MBProgressHUD showError:@"收藏失败"];
            [MBProgressHUD showError:response[@"message"]];
            
        }
        
        
        
    } failure:^(NSString *error) {
        
        
        [MBProgressHUD showError:@"收藏失败"];
        
    }];
    
    
    
    
}


// 关注 
- (void)touxiangimageViewTap {
    
    
    
    NSString *type =  @"";
    [self.delegate  kaipianViewcl_tableViewCellPlayVideoWithCell:self];
    
    if ([self.model.is_guanzhu isEqualToString:@"0"]) {
        
        type =  @"0";
        
        
    } else {
        
        type =  @"1";
        
    }
    
    
    NSString *uid = [HWLocallyStoredData getLoginUserID];
    NSString *tString = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    //  NSString *gidStr = [NSString stringWithFormat:@"%@",self.gameId];
    NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uid,tString,@"fsd213ewdsadqwe2121213edsad"];
    NSString *signMD5 = [WMUtil md5HexDigest:signStr];
    
    
    
    NSDictionary *parametes = @{
        
        @"uid":uid,
        @"t":tString,
        @"sign":signMD5,
        @"id":self.model.id,
        @"ct":@"app",
        @"ac":@"video_guanzhu",
        @"type":type,
        @"ios" : @"1",
        @"member_id":[HWLocallyStoredData getCode],
        
        
        
        
    };
    
    
    
    
    [HWWebUtils do3GetWithParameters:parametes progress:nil success:^(id response) {
        
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        
        if ([codeStr intValue] == 1) {
            // [MBProgressHUD showMessage:@"收藏成功" toView:self.view];
            
            
            //    self.model.zan
            
            if ([type isEqualToString:@"1"]) {
                
                
                self.model.is_guanzhu = @"0";
                
                self.jiaGuanImageView.hidden = NO;
                
                
                
            } else {
                
                self.model.is_guanzhu = @"1";
                self.jiaGuanImageView.hidden = YES;
                
                
            }
            
            
            
            
            
        } else {
            
            
            // [MBProgressHUD showError:@"收藏失败"];
            [MBProgressHUD showError:response[@"message"]];
            
        }
        
        
        
    } failure:^(NSString *error) {
        
        
        [MBProgressHUD showError:@"收藏失败"];
        
    }];
    
    
    
    
    
    
}


//-(void)setFrame:(CGRect)frame {
//
//
// //     frame.size.height = CLscreenHeight +49;
//    [super setFrame:frame];
//
//
//
//
//
//}


//
- (void)pinglunButonTap {
    
    NSLog(@"123456");
    [self.delegate  kaipianViewcl_tableViewCellPlayVideoWithCell:self];
    HWCommentspingluView *comentspinglun = [[HWCommentspingluView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
    comentspinglun.idStr = self.model.id;
    [comentspinglun refreshData];
    [kKeyWindow addSubview:comentspinglun];
    
    
    
}



- (void)fenxiangButonTap {
    [self.delegate  kaipianViewcl_tableViewCellPlayVideoWithCell:self];
    
    HWerweiMaFenXiangView  *fenxiang = [[HWerweiMaFenXiangView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
    fenxiang.urlStr = self.model.fenxiang;
    [kKeyWindow addSubview:fenxiang];
    
    
    
    
}



- (void)kaipian  {
    
    [self.delegate  kaipianViewcl_tableViewCellPlayVideoWithCell:self];
    
    
    NSLog(@"dncdnsndnnf");
    
}

@end
